package com.wwtech.epp.ui.adapter.work;

import android.support.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wwtech.epp.R;
import com.wwtech.epp.entity.appmessage.AppMessage;
import com.wwtech.epp.view.GlideCircleTransform;

import java.util.ArrayList;

import io.rong.imkit.widget.AsyncImageView;

/**
 * 作者：Android on 2017/10/17
 * 邮箱：365941593@qq.com
 * 描述：
 */

public class PolymerizationMessageAdapter extends BaseQuickAdapter<ArrayList<AppMessage>, BaseViewHolder> {

    public PolymerizationMessageAdapter(@Nullable ArrayList<ArrayList<AppMessage>> data) {
        super(R.layout.item_poly_message, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, ArrayList<AppMessage> appMessage) {
        baseViewHolder.setText(R.id.app_name, appMessage.get(0).getAppName());
        baseViewHolder.setText(R.id.app_content, appMessage.get(0).getAppName());
        AsyncImageView imageView = baseViewHolder.getView(R.id.rc_left);
        Glide.with(mContext)
                .load(appMessage.get(0).getResourceUrl())
                .transform(new GlideCircleTransform(mContext))
                .into(imageView);
    }
}
